//
//  DYPayBottomView.swift
//  SheYangBigData
//
//  Created by 叁拾叁 on 2021/2/7.
//  Copyright © 2021 叁拾叁. All rights reserved.
//

import UIKit

class DYPayBottomView: SYBaseView {

    var alert : DYYuyueAlert!
    
    let tijiao: UIButton = {
        let v: UIButton  = UIButton(frame: CGRect(x: 0, y: 0, width: SCREEN_WIDTH - 30.autoWidth(), height: 44.autoWidth()))
        v.vg_gradLayerCreat(leftC: UIColor(hex: 0xFF7F00), rightC: UIColor(hex: 0xFF9700))
        v.setTitle("立即支付", for: .normal)
        v.setTitleColor(UIColor.white, for: .normal)
        v.titleLabel?.font = 18.autoFontSize()
        v.layer.cornerRadius = 5
        v.layer.masksToBounds = true
        return v
    }()

    override func initViews() {
        tijiao.addAction {[weak self] in
            if let `self` = self {
                self.setAlert()
                
            }
        }
        addSubview(tijiao)
        
    }
    
    func setAlert() {
        alert = DYYuyueAlert()
        let window = UIApplication.shared.keyWindow
        window?.addSubview(alert)
        alert.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
        }
    }
}
